import {
  Swiper,
  SwiperItem,
  View,
  Text,
  Image,
  Button,
  ScrollView,
} from "@tarojs/components";
import Taro, { useLoad, useRouter, useDidShow, useShareAppMessage } from "@tarojs/taro";
import "./index.scss";
import MerchantItem from "../../components/MerchantItem/index";
import { getGlobalData } from "../../globalData";
import UserDialogLogin from "@/components/UserDialogLogin";
import { useState } from "react";
import { request } from "@/utils/request";
import { isLogin, markPhone } from "@/utils/tools";
import { AtModal, AtModalHeader, AtModalContent, AtModalAction,AtIcon } from "taro-ui";



export default function Index() {
  const [hasLogin, setHasLogin] = useState(true);
  const [loginDialogVisible, setLoginDialogVisible] = useState(false);
  const [inviteDialogVisible, setInviteDialogVisible] = useState(false);
  const [ruleDesc2, setRuleDesc2] = useState("");
  const [groupId, setGroupId] = useState("");
  // 邀请人手机号
  const [userPhone, setUserPhone] = useState("");
  // 当前登录人手机号
  const [custPhone, setCustPhone] = useState('');
  const [hotActivityList, setHotActivityList] = useState([]);
  // const [familyNum, setFamilyNum] = useState(1);
  // const [familyPointsNum, setFamilyPointsNum] = useState(0);
  const [baoZhangNum, setBaoZhangNum] = useState(0);
  const [baoDanNum, setBaoDanNum] = useState(0);
  const [curActivityTypeId, setCurActivityTypeId] = useState(0);
  const [activityTypeList, setActivityTypeList] = useState<any[]>([]);
  // const [curTypeActivityList, setCurTypeActivityList] = useState(null);
  const [menuBarHeight, setMenuBarHeight] = useState('0px');
  const [statusBarHeight,setStatusBarHeight] = useState('44px')
  const [iconList,setIconList] = useState([
    {
      icon:'https://wanhuhealth.oss-cn-beijing.aliyuncs.com/static/mini-jifen/images/index2/dbbz.png',
      title:'积分兑换',
      num:'',
      unit:'公益服务',
      btnText:'去兑换',
      onIconClick:()=>{
        jumpToClaimJiFenPage()
      },
      onBtnClick:()=>{
        jumpToClaimJiFenPage()
      }
    },
    // {
    //   status:'hidden',
    //   icon:'https://wanhuhealth.oss-cn-beijing.aliyuncs.com/static/mini-jifen/images/index2/ybdj.png',
    //   title:'医保代缴',
    //   num:0,
    //   unit:'次',
    //   btnText:'去缴费',
    //   onIconClick:()=>{
    //     jumpToPayOrderList()
    //   },
    //   onBtnClick:()=>{
    //     jumpToPayment()
    //   }
    // },
    {
      icon:'https://wanhuhealth.oss-cn-beijing.aliyuncs.com/static/mini-jifen/images/index2/jtcy.png',
      title:'家庭成员',
      num:0,
      unit:'人',
      btnText:'填成员',
      onIconClick:()=>{
        // 添加家人，打开添加家人面板
        jumpToFamilyGroupPage()
      },
      onBtnClick:()=>{
        
        jumpToFamilyGroupPageWithAddPanel()
      }
    },
    {
      icon:'https://wanhuhealth.oss-cn-beijing.aliyuncs.com/static/mini-jifen/images/index2/qjjf.png',
      title:'全家积分',
      num:0,
      unit:'分',
      btnText:'攒积分',
      onIconClick:()=>{
        jumpToFamilyPointsPage()
      },
      onBtnClick:()=>{
        jumpToJFActivity()
      }
    },
    
    // {
    //   icon:'https://wanhuhealth.oss-cn-beijing.aliyuncs.com/static/mini-jifen/images/index2/dbbz.png',
    //   title:'大病保障',
    //   num:0,
    //   unit:'人',
    //   btnText:'领保障',
    //   onIconClick:()=>{
    //     jumpToFamilyInsList()
    //   },
    //   onBtnClick:()=>{
    //     jumpAddInsurancePage()
    //   }
    // }
  ])
  
  // console.log('getGlobalData("isRelease"):',getGlobalData('isRelease'))
  // const [isRelease] = useState(getGlobalData('release'));
  const isRelease = getGlobalData('isRelease');
  // console.log('isRelease:',isRelease)
  // 用户邀请变量
  let openid: string = "";

  useShareAppMessage((res) => {
    return {
      title: "万户健康",
      path: `/pages/index/index`,
    }
  })
 

  function setStorageCustPhone(){
    let custPhoneStorage = Taro.getStorageSync("custPhone") || ''
    setCustPhone(custPhoneStorage)
  }

  function jumpToJFActivity(){
    Taro.pageScrollTo({
      selector:'#hotMerchant',
      offsetTop:-50,
    })
  }

  // 获取动态菜单栏样式
  function getStatusBarAndMenuButtonInfo() {
    // 单位都是px
    // 胶囊高度
    let menuButtonInfo = Taro.getMenuButtonBoundingClientRect()
    let menuButtonHeight = menuButtonInfo.height //  获取胶囊高度
    let res = Taro.getSystemInfoSync()
    // 状态栏高度
    let statusBarHeight = res.statusBarHeight as number
    // 胶囊距离状态栏边距
    let top = menuButtonInfo.top - statusBarHeight //  获取top值
    // 导航栏高度：胶囊按钮+上下边距
    let menuBarHeight = menuButtonHeight + top * 2
    // 状态栏高度
    setStatusBarHeight(statusBarHeight+'px')
    setMenuBarHeight(menuBarHeight+'px')
  }

  function getActivityList(noAuth) {
    request({
      url: "/api/points/activity/getAllTypeActivities",
      noAuth: noAuth,
      success: (data) => {
        if(data.length > 0){
          let storageTypeId = Taro.getStorageSync("/pages/index/index/typeId");

          data.forEach((item) => {
            item.pointsActivityDTOS = item.pointsActivityDTOS.filter((item) => {
              return !item.finished
            })
          })

          setActivityTypeList(data)
          let tempTypeObj = data[0]
          if (storageTypeId) {
            let tempTypeObj2 = data.find((type) => {
              return type.typeId === storageTypeId;
            });
            if (tempTypeObj2) {
              tempTypeObj = tempTypeObj2;
            }
          }
          setCurActivityTypeId(tempTypeObj.typeId)
          // 已完成的任务不展示
          let activityList = tempTypeObj.pointsActivityDTOS
          // activityList = activityList.filter((item)=>{
          //   return !item.finished
          // })
          setHotActivityList(activityList);
          // let tempTypeObj = data.find(type=>{
          //   return type.typeId === curActivityTypeId
          // })
          
          // if(tempTypeObj){
          //   setHotActivityList(tempTypeObj.pointsActivityDTOS);
          // }
        }
        
      },
      fail: (err) => {
        console.log("getActivityList err", err);
      },
      complete: () => {
        console.log('complete')
      }
    });
  }
  // function getFamilyGroupPoints() {
  //   request({
  //     url: "/api/points/family/getFamilyReceiveRecord",
  //     success: (data) => {
  //       setFamilyPointsNum(data.totalPoints || 0);
  //       Taro.setStorageSync("familyPointsNum", data.totalPoints || 0);
  //     },
  //   });
  // }
  // 获取家庭成员情况
  // function getFamilyGroupList() {
  //   request({
  //     url: "/api/points/family/queryList",
  //     data: {
  //       token: Taro.getStorageSync("token"),
  //       openId: Taro.getStorageSync("openid"),
  //     },
  //     success: (data) => {
  //       // console.log("getFamilyGroupList", data);
  //       setFamilyNum(data.respDataList.length + 1);
  //     },
  //   });
  // }

  function getFamilyGroupInsurance() {
    request({
      url: "/api/points/family/getFamilyInsurance",
      success: (data) => {
        // console.log('getFamilyGroupInsurance',data)
        if (data.length > 0) {
          // 全家
          let baodanNum = data[0].familyInsuranceDetailDTOList.length || 0;
          if (baodanNum > 0) {
            setBaoDanNum(baodanNum);
          }
          
          // 第一个是总的 全家
          let baozhangNum = data.slice(1).filter((item) => {
            return item.familyInsuranceDetailDTOList.length > 0;
          }).length;
          setBaoZhangNum(baozhangNum);
          // 使用此处接口获取保障数量
          // iconList[3].num = baozhangNum;
          setIconList([...iconList]);
          
        }
      },
    });
  }

  // 家庭群邀请 groupId=547&userPhone=15626473067&ruleDesc2=2
  const menuButtonTop = getGlobalData("menuButtonTop");
  const menuButtonHeight = getGlobalData("menuButtonHeight");
  
  function jumpToFamilyPointsPage() {
    console.log('jumpToFamilyPointsPage')
    if (isLogin()) {
      Taro.navigateTo({ url: "/pages/myFamilyPoints/index" });
    } else {
      setLoginDialogVisible(true);
    }
  }
  function jumpToFamilyGroupPageWithAddPanel(){
    if (isLogin()) {
      Taro.navigateTo({ url: "/pages/myFamilyGroup/index?showAddFamily=1" });
    } else {
      setLoginDialogVisible(true);
    }
  }
  function jumpToFamilyGroupPage() {
    console.log('jumpToFamilyGroupPage')
    if (isLogin()) {
      Taro.navigateTo({ url: "/pages/myFamilyGroup/index" });
    } else {
      setLoginDialogVisible(true);
    }
  }
  function jumpToFamilyInsList(){
    if (isLogin()) {
      Taro.navigateTo({ url: "/pages/familyIns/index" });
    } else {
      setLoginDialogVisible(true);
    }
  }
  function jumpAddInsurancePage() {
    console.log('jumpAddInsurancePage')
    if (isLogin()) {
      Taro.navigateTo({ url: "/pages/addInsurance/index" });
    } else {
      setLoginDialogVisible(true);
    }
  }
  // 接受邀请对话框
  function acceptInviteDialog() {
    console.log('acceptInviteDialog')
    // 获取openid
    openid = Taro.getStorageSync("openid");
    // 如果未登录
    if (!isLogin()) {
      // 设置邀请同意状态为0
      Taro.setStorageSync("inviteAgree", 0);
      // 创建邀请对象
      var inviteObj = {
        ruleDesc2: ruleDesc2,
        shareToType: 10,
        groupId: groupId,
        clientType: 2,
      };
      // 设置邀请群组id
      Taro.setStorageSync("inviteGroupId", groupId);
      // 设置邀请对象
      Taro.setStorageSync("inviteObj", inviteObj);
      // 显示登录对话框
      setLoginDialogVisible(true);
      // 隐藏邀请对话框
      hideInviteDialog();
      return;
    }
    console.log('groupId:',groupId)
    console.log('openid:',openid)
    // 发送请求
    request({
      url: "/api/points/family/agree/" + groupId + "/2/" + openid,
      data: {
        token: Taro.getStorageSync("token"),
        openId: openid,
      },
      method: "post",
      success: function (res) {
        // 显示提示信息
        Taro.showToast({
          icon: "none",
          title: "您已加入家庭群",
        });
      },
      complete: function () {
        // 隐藏邀请对话框
        hideInviteDialog();
        console.log('acceptInviteDialog complete')
        // getFamilyGroupList()
        // 
        loginCallback()
        
      },
    });
  }
  function getInviteStatus(options) {
    console.log("getInviteStatus:", options);
    request({
      url: `/api/points/family/queryGroupState/${options.groupId}`,
      noAuth: true,
      success(status) {
        console.log("queryGroupState status:", status);
        if (status == 2) {
          Taro.showToast({
            icon: "none",
            title: "已拒绝邀请，重新发送邀请可再次加入",
            duration: 3000,
          });
        } else if (status == 1) {
          Taro.showToast({
            icon: "none",
            title: "您已加入家庭组",
          });
        } else {
          setGroupId(options.groupId);
          setUserPhone(options.userPhone);
          setRuleDesc2(options.ruleDesc2);
          const inviteGroupId = Taro.getStorageSync("inviteGroupId");
          console.log("userPhone:", userPhone, options.userPhone);
          console.log("inviteGroupId:", inviteGroupId);
          if (
            options.userPhone !== Taro.getStorageSync("custPhone") &&
            (!inviteGroupId || groupId != inviteGroupId)
          ) {
            setInviteDialogVisible(true);
          }
        }
      },
    });
  }

  function hideInviteDialog() {
    setInviteDialogVisible(false);
    
  }
  function closeInviteDialog() {
    openid = Taro.getStorageSync("openid");
    console.log("closeInviteDialog");
    var inviteObj = {
      ruleDesc2: ruleDesc2,
      shareToType: 11,
      groupId: groupId,
      clientType: 2,
    };
    hideInviteDialog();
    Taro.setStorageSync("disagreeInviteObjGroupId", groupId);
    Taro.setStorageSync("inviteObj", inviteObj);
    console.log('isLogin:',!!isLogin())
    if (!isLogin()) {
      setLoginDialogVisible(true);
      return;
    }
    if(!!isLogin())
    request({
      url: "/api/points/family/disAgree/" + groupId + "/2/" + openid,
      data: {
        token: Taro.getStorageSync("token"),
        openId: openid,
      },
      method: "post",
      complete: function () {
        console.log('disAgree complete')
        hideInviteDialog();
      },
    });
  }

  function jumpToFamilyIns() {
    console.log('jumpToFamilyIns')
    if (isLogin()) {
      Taro.navigateTo({
        url: "/pages/familyIns/index",
      });
    } else {
      setLoginDialogVisible(true);
    }
  }

  function jumpToActivityDetailPage(activity) {
    console.log('jumpToActivityDetailPage')
    // if (isLogin()) {
    //   Taro.navigateTo({
    //     url: "/pages/activityDetail/index?activityId=" + activity.id,
    //   });
    // } else {
    //   setLoginDialogVisible(true);
    // }
    // if(!isLogin()){
    //   setLoginDialogVisible(true);
    //   return 
    // }
    if(activity.category ===0){
      Taro.navigateTo({
        url: "/pages/activityDetail/index?activityId=" + activity.id,
      });
    }else {
      Taro.navigateTo({
        url: "/pages/h5task/index?activityId=" + activity.id,
      });
      let key = '/pages/h5task/index/activityId'
      Taro.setStorageSync(key, activity.id);
    }
    
  }
  // 获取分类列表


  function changeActivityTypeId(typeId){
    Taro.setStorageSync('/pages/index/index/typeId',typeId)
    setCurActivityTypeId(typeId)
    let curActivityList = activityTypeList.find(item => item.typeId == typeId)
    setHotActivityList(curActivityList.pointsActivityDTOS)
  }

  function goFuliBuyPage(){
    if (isLogin()) {
      Taro.navigateTo({
        url: "/pages/buyMedicine/index",
      })
    }else{
      setLoginDialogVisible(true)
    }
    
  }
  function jumpToClaimJiFenPage(){
    if (isLogin()) {
      Taro.navigateTo({
        url: '/pages/claimJiFen/index'
      })
    } else {
      setLoginDialogVisible(true);
    }
  }
  function jumpToDonationHelpPage(){
    if (isLogin()) {
      Taro.navigateTo({
        url: '/pages/donationHelp/index'
      })
    } else {
      setLoginDialogVisible(true);
    }
  }
  
  function jumpToPayOrderList(){
    if (isLogin()) {
      Taro.navigateTo({
        url: '/pages/payOrderList/index'
      })
    } else {
      setLoginDialogVisible(true);
    }
  }
  function jumpToPayment(){
    if (isLogin()) {
      Taro.navigateTo({
        url: '/pages/payment/index'
      })
    } else {
      setLoginDialogVisible(true);
    }
  }
  function jumpToYGPage(){
    Taro.navigateTo({
      url:'/pages/pureText/index?page=page1'
    })
  }
  function jumpToJFBDesPage(){
    Taro.navigateTo({
      url:'/pages/pureText/index?page=page3'
    })
  }
  // 跳转到购药小程序
  function jumpToGYPage(){
    Taro.navigateTo({
      url:'/pages/pureText/index?page=page2'
    })
  }
  // 跳转到ai
  function jumpToAIPage(){
    Taro.navigateTo({
      url:'/pages/pureText/index?page=page4'
    })
  }

  function getHomeData(){
    let user = Taro.getStorageSync("user");
    if(user && user.id){
      request({
        url: `/api/payment/order/homePage`,
        data: {
          token: Taro.getStorageSync("token"),
        },
        method: 'POST',
        success: function(data){
          console.log('getHomeData data:',data)
          // 家庭成员
          iconList[1].num = data.familyMemberNum || 1
          // 全家积分
          iconList[2].num = data.familyPoints
          // iconList[1].num = data.paymentOrderNum
          // 大病保障使用接口获取数据，而不使用这个地方的数据
          // iconList[3].num = data.majorDiseaseCoverageNum
          setIconList([...iconList])
          Taro.setStorageSync("familyPointsNum", data.familyPoints || 0);
        }
      })
    }
    
  }

  
  function loginCallback(){
    setStorageCustPhone()
    setHasLogin(true);
    // 获取家庭组积分
    // getFamilyGroupPoints();
    // 查看家庭成员保险情况
    getFamilyGroupInsurance();
    getActivityList(false);
    // 刷新数据
    getHomeData()
  }
  useDidShow(() => {
    console.log('useDidShow')
    let token = Taro.getStorageSync("token");
    if (token) {
      // 用户已登录
      // 设置手机号
      loginCallback()

    } else {
      setHasLogin(false);
      getActivityList(true);
    }
    openid = Taro.getStorageSync("openid");
    // 获取活动列表
  });
  // 用户邀请链接 groupId=547&userPhone=15626473067&ruleDesc2=2
  useLoad((options) => {
    // 获取状态栏高度和胶囊按钮高度
    getStatusBarAndMenuButtonInfo()
    // 获取分裂列表
    // getActivityTypeList()
    if (options.groupId && options.userPhone && options.ruleDesc2) {
      let disagreeInviteObjGroupId = Taro.getStorageSync(
        "disagreeInviteObjGroupId"
      );
      if (
        disagreeInviteObjGroupId &&
        Number(disagreeInviteObjGroupId) === Number(options.groupId)
      ) {
        // 已经被拒绝过了
        Taro.showToast({
          icon: "none",
          title: "已拒绝邀请，可重新发送邀请",
          duration: 3000,
        });
      } else {
        // 查询用户是否拒绝过
        getInviteStatus(options);
      }
    }else {
      // 如果没有邀请，登录已过期，就显示登录
      if(options.showLogin ==='1'){
        setLoginDialogVisible(true)
      }
    }
  });

  return (
    <View className="index">
      <View className="header" style={{ 'paddingTop': statusBarHeight }}>
        {/* 顶部 */}
        <View className="title-box" style={{'height':menuBarHeight,'lineHeight':menuBarHeight}}>
          <Text className='title'>积分宝</Text>
          <Text className='info'>积分共济，全家共享</Text>
        </View>
        <View className='intro'>
          <View className="txt" onClick={jumpToYGPage} data-page="page1">
          <View className="t-left">
            <View className="">万户健康</View>
            <View className="">医改探索</View>
          </View>
          <View className="t-line" />
          <View className="t-right">
            <View className="t-r-1">
              <View className="t-r-1__txt">少得病</View>
              <View className="t-r-1__txt">少花钱</View>
              <View className="t-r-1__txt">少跑腿</View>
            </View>
            <View className="t-r-2">一站式改善老百姓三大主要医改诉求</View>
          </View>
        </View>
        </View>
      </View>
      <View className="user">
        {/* 用户头像 */}
        <View className='info'>
          <View className="avatar">
            <Image className="avatar-img" src="https://wanhuhealth.oss-cn-beijing.aliyuncs.com/static/mini-jifen/images/index2/default-avatar2.png" mode="widthFix" />
          </View>
          <View className='phone'>{ markPhone(custPhone) }</View>
        </View>
        <View className='jf' onClick={jumpToJFBDesPage}>
          <Text className='txt'>什么是积分宝</Text>
          <AtIcon className='icon' value='help' size='8' color='#666'></AtIcon>
        </View>
      </View>
      { isRelease && 
        <View className='icon-panel'>
          { iconList.map((item,index) => {
            return (
            <View className='icon-item'>
              <View className='img-wrap' onClick={item.onIconClick}>
                <Image className='img' src={item.icon} mode='aspectFit' />
              </View>
              <View className='title'>{item.title}</View>
              <View className='desc'>{item.num}{item.unit}</View>
              <View className='btn' onClick={item.onBtnClick}>{item.btnText}</View>
            </View>)
          })
          }
        </View>
      }
      {/* 兑换 */}
      { isRelease && 
      <View className="claim" onClick={jumpToClaimJiFenPage}>
        <View className='year'>2026年度</View>
        <View className='btn-link'>立即兑换</View>
        <View className='banner'>
          {/* <View className='title'>积分缴医保，省钱超简单</View> */}
          <Image className='img' src="https://wanhuhealth.oss-cn-beijing.aliyuncs.com/static/mini-jifen/images/jieshao/sy-jifenbao-banner.jpg" mode='widthFix'/>
        </View>
      </View>
      }
      {/* 公益互助 */}
      {/* <View className="donation" onClick={jumpToDonationHelpPage}>
        <View className='banner'>
          <View className='title'>公益互助</View>
          <View className='title'>累计7819.1元</View>
          <View className='title'>实现互助1111人</View>
        </View>
        <View className='btn-group'>
          <View className='btn'>申请互助</View>
          <View className='line'></View>
          <View className='btn'>捐赠积分</View>
        </View>
      </View> */}
      {
        isRelease && 
        <View className='service'>
          <View className='title'>服务攒积分</View>
          <View className='img-group'>
            <View className='img-wrap' onClick={jumpToGYPage}>
              <Image className='img img1' src='https://wanhuhealth.oss-cn-beijing.aliyuncs.com/static/mini-jifen/images/index2/ybdy.png'></Image>
            </View>
            <View className='img-wrap' onClick={jumpToAIPage}>
              <Image className='img img2' src='https://wanhuhealth.oss-cn-beijing.aliyuncs.com/static/mini-jifen/images/index2/aisz.png'></Image>
            </View>
          </View>
        </View>
      }

      <View className="page-content">
        {/* 全家保障 */}
        {/* 暂时隐藏掉全家保障 */}
        {  false && isRelease && 
          <View className="family">
            <View className="family-header">
              <Text className="title">全家保障</Text>
              <View className="ins-btn">
                <Text className="ins-btn-text" onClick={jumpAddInsurancePage}>
                  领取保障
                </Text>
                {/* <AtIcon value='chevron-right' size='14' color='#FFF'></AtIcon> */}
              </View>
            </View>
            <View className="family-content" onClick={jumpToFamilyIns}>
              <View className="content-left">
                <View className="info">
                  <Text className="danger">{baoZhangNum}</Text>人保障中
                </View>
                <View className="info">
                  <Text className="danger">{baoDanNum}</Text>份保单
                </View>
              </View>
              <View className="content-right"> 立即查看 </View>
            </View>
          </View>
        }
        
        {/* 热门积分商户 */}
        <View className="account">
          <View className="account-header">
            <Text className="title" id='hotMerchant'>活动攒积分</Text>
          </View>
          <View className="account-type">
            <ScrollView scrollX scrollWithAnimation>
              <View className="type-list">
                {activityTypeList.map((type,index) => {
                    return <View key={index} className={["type-item",curActivityTypeId ===type.typeId ? 'active' : ''].join(' ')} onClick={() => {changeActivityTypeId(type.typeId)}}>{type.title}</View>;
                  })}
              </View>
            </ScrollView>
          </View>
          <View className="account-content">
            {hotActivityList.map((activity: any, index: number) => (
              <View
                className="jifen-item"
                onClick={() => {
                  jumpToActivityDetailPage(activity);
                }}
              >
                <View className='jifen-item-left'>
                  <Image className='img' src={activity.coverImage} mode='aspectFill'></Image>
                </View>
                <View className='jifen-item-right'>
                  <View className='title'>
                    {activity.title}
                  </View>
                  <View className='jifen-num'>
                  +{activity.points} 积分
                  </View>
                  <View className={['btn',activity.finished ? "complete" : "pending"].join(" ")}>
                    {activity.finished ? "任务完成" : "立即参与"}
                  </View>
                </View>
              </View>
            ))}
          </View>
        </View>
        {/* 热门积分活动 */}
      </View>
      <UserDialogLogin
        visible={loginDialogVisible}
        title="提示"
        content="请先登录"
        btnText="去登录"
        cancel={()=>{
          setLoginDialogVisible(false);
        }}
        close={() => {
          setLoginDialogVisible(false);
        }}
      ></UserDialogLogin>
      {/* 邀请弹窗 */}
      <AtModal isOpened={inviteDialogVisible}>
        <AtModalHeader>家庭群邀请</AtModalHeader>
        <AtModalContent>
          <View className="txt">
            你的{ruleDesc2}（{markPhone(userPhone)}），邀请你加入家庭群!
          </View>
          <View className="txt">
            加入家庭群，可以更好的了解和管理家人的健康，更方便的与家人沟通！
          </View>
        </AtModalContent>
        <AtModalAction>
          <Button onClick={closeInviteDialog}>忽略</Button>
          <Button type="primary" onClick={acceptInviteDialog}>
            接受
          </Button>
        </AtModalAction>
      </AtModal>
    </View>
  );
}
